package com.itheima.demo02.Recursion;

import java.io.File;

public class Demo05Recursion {
    public static void main(String[] args) {
        File file = new File("D:\\Java-Code\\day08_FileAndRecursion\\abc");
        getAllFiles(file);
    }

    public static void getAllFiles(File dir) {
//        System.out.println(dir);
        File[] files = dir.listFiles();
        for (File f : files) {
            if (f.isDirectory()) {
                getAllFiles(f);
            } else {
                /*String s = f.toString();
                s = s.toLowerCase();*/
                if (f.getName().toLowerCase().endsWith(".java")) {
                    System.out.println(f);
                }
            }
        }
    }
}
